<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('消毒')" />
	<th:block th:include="include :: select2-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
	<form class="form-horizontal m" id="form-ncWorkNotice-disinfection" th:object="${disinfection}">

		<input name="yaoId" type="hidden" id="treeId"/>

		<input name="workNoticeId"  th:field="*{workNoticeId}" type="hidden"  />
		<div class="form-group">
			<label class="col-sm-3 control-label">消毒时间：</label>
			<div class="col-sm-8">
				<input id="dfDate" data-format="yyyy-MM-dd HH:mm:ss"  name="dfDate" placeholder="请选择时间"  th:value="*{#dates.format(new java.util.Date().getTime(), 'yyyy-MM-dd HH:mm:ss')}" class="form-control" type="text" th:class="time-input" data-type="datetime" >
				<!--<input id="dfDate" name="dfDate" class="form-control" type="text">-->
			</div>
		</div>

		<div class="form-group">
			<label class="col-sm-3 control-label ">消毒场所：</label>
			<div class="col-sm-8">
				<input class="form-control" type="text" name="dfPlace" required/>
			</div>
		</div>

		<!--药品批次-->
		<!--<input id="dfCode" name="dfCode" class="form-control" type="hidden">-->

		<div class="form-group">
			<label class="col-sm-3 control-label ">药品名称：</label>
			<div class="col-sm-8">
				<div class="input-group">
					<input name="dfName" onclick="selectdisinfectionTree()" id="treeName" type="text" readonly="true" placeholder="请选择" class="form-control" required>
					<span class="input-group-addon"><i class="fa fa-search"></i></span>
				</div>

				<!--<input class="form-control" type="text" name="dfName" />-->
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label ">使用数量：</label>
			<div class="col-sm-8">
				<input class="form-control" type="number" name="dfUsed" required onkeyup=" value=value.replace(/^(0+)|[^\d]+/g,'')" min="0">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label ">使用浓度：</label>
			<div class="col-sm-8">
				<input class="form-control" type="number" name="dfDensity" required min="0"/>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label ">消毒方法：</label>
			<div class="col-sm-8">
				<select name="dfType" class="form-control m-b" th:with="type=${@dict.getType('xiaoduType')}">
					<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" ></option>

				</select>

				<!--<input class="form-control" type="text" name="dfType" />-->
			</div>
		</div>



		<div class="form-group">
			<label class="col-sm-3 control-label">备注：</label>
			<div class="col-sm-8">
				<textarea class="form-control" type="text" name="remark" id="remark" rows="4" > </textarea>
			</div>
		</div>
	</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: select2-js" />
<script>
	function submitHandler() {
		if ($.validate.form()) {
			$.operate.save(ctx + "system/ncChickenWorkNotice/disinfection", $('#form-ncWorkNotice-disinfection').serialize());
		}
	}

	//药品选择树
	function selectdisinfectionTree() {
		var treeId = $("#treeId").val();
		var disinfectionId = $.common.isEmpty(treeId) ? "1" : $("#treeId").val();
		var url = ctx + "system/ncYaoClass/selectYaoTree/" + disinfectionId;
		var options = {
			title: '药品选择',
			width: "380",
			url: url,
			callBack: doSubmit
		};
		$.modal.openOptions(options);
	}

	function doSubmit(index, layero) {
		var body = layer.getChildFrame('body', index);
		$("#treeId").val(body.find('#treeId').val());
		$("#treeName").val(body.find('#treeName').val());
		layer.close(index);
	}

</script>
</body>

</html>
